<template>
  <a-table bordered size="middle" v-bind="$attrs" :columns="data.columns" :data-source="data.data">
    <template v-slot:switch="record">
      <CustomSwitch disabled v-model:value="record.record[record.column.key]" />
    </template>
    <template v-slot:operation="record">
      <slot name="operation" :record="record"></slot>
    </template>
  </a-table>
</template>

<script>
import CustomSwitch from '../form-item/custom-switch.vue';
export default {
  name: 'CustomTable',
  components: {
    CustomSwitch
  },
  props: {
    data: {
      type: Object,
      default: () => {
        return {
          columns: [],
          data: []
        };
      }
    }
  },
  setup() {
    return {};
  }
};
</script>
